//
//  EMLoanProductTableViewCell.m
//  EasyMoney
//
//  Created by zh on 2020/1/11.
//  Copyright © 2020 zh. All rights reserved.
//

#import "EMLoanProductTableViewCell.h"

@interface EMLoanProductTableViewCell ()

@property (nonatomic, strong) UIImageView *productImageView;

@end

@implementation EMLoanProductTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = [UIColor whiteColor];;
        self.contentView.backgroundColor = [UIColor whiteColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.productImageView = [[UIImageView alloc]init];
        self.productImageView.contentMode = UIViewContentModeScaleAspectFill;
        [self.contentView addSubview:self.productImageView];
        CGFloat imageHeight = (106 * SCREEN_WIDTH)/375.0;
        self.productImageView.layer.cornerRadius = 8;
        self.productImageView.layer.masksToBounds = YES;
        self.productImageView.backgroundColor = [UIColor lightGrayColor];
        [self.productImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(16);
            make.right.mas_equalTo(-16);
            make.top.mas_equalTo(27);
            make.bottom.equalTo(self.contentView);
            make.height.mas_equalTo(imageHeight);
        }];
    }
    return self;
}
-(void)setProductURL:(NSString *)productURL{
    _productURL = productURL;
    [self.productImageView yy_setImageWithURL:[NSURL URLWithString:productURL] options:YYWebImageOptionAllowInvalidSSLCertificates];

}
@end
